<!-- 告警记录 -->
<template>
  <div class="common-body-wrapper">
    <search-header
      single-width="130"
      :searchList="searchList"
      @changeHeight="toRetTable"
      :paramName="paramName"
      @confirmSearch="toSearch"
      :isNeedTree="true"
      :isCheckbox="true"
      @setSelectedNode="setSelectedNode"
    ></search-header>
    <div class="common-table-tree-wrapper">
      <div class="common-table-wrapper">
        <multi-fun-table
          :sortColumn="notFormatColumn"
          :orderType="sortType"
          :fixed-cols="fixedCols"
          :is-reset-table="isResetTable"
          :theads-info="theadsInfo"
          :tbodys-info="tbodysInfo"
          @handleMultiCheck="handleMultiCheck"
          @handleSortColumn="handleSortColumn"
          @searchFn="getList"
          @getNextPage="getNextPage"
        >
          <div class="operate-btn-group" slot="operateBtnGroup">
            <a
              class="ake_btn ake_btn_text"
              v-if="isPermmited('PARK_EMERGENCY_RECORD:EXPORT')"
              @click.prevent="exportData()"
            >导出</a>
          </div>
          <template slot="tdCell" slot-scope="props">
            <el-table-column
              :fixed="props.fixed"
              :label="props.label"
              :min-width="props.minWidth"
              :width="props.width"
              :prop="props.prop"
              :sortable="props.sortable"
            >
              <template slot-scope="scope">
                <span v-if="'reno' == props.prop">{{scope.$index+1}}</span>
                <span v-else>{{ scope.row[props.prop] }}</span>
              </template>
            </el-table-column>
          </template>
        </multi-fun-table>

        <table-pagination :size="total" :cur-page="pageNumber" @backData="getPagination"></table-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import common from "@mixins/common.js";
import stardardList from "@mixins/tables/stardardList.js";

//modal
import invokeModal from "@mixins/modal/invokeModal.js";

// 引进vue的js
import emergency_record from "./js/emergency_record.js";

export default {
  name: "emergencyRecord",
  mixins: [common, stardardList, invokeModal, emergency_record],
  data() {
    const today = [
      new Date(moment().format("YYYY-MM-DD 00:00:00")),
      new Date(moment().format("YYYY-MM-DD 23:59:59"))
    ];

    return {
      fixedCols: 0,
      total: 0,
      paramName: "parkIds",
      searchList: [
        {
          index: 0,
          isShow: false,
          type: "select",
          name: "carType",
          text: "车辆类型",
          value: "0",
          options: [
            { name: "指定车辆", value: "0" },
            { name: "黑名单", value: "4" },
            { name: "白名单", value: "8" }
          ],
          style: { width: "120px" }
        },
        {
          index: 1,
          isShow: false,
          type: "text",
          name: "carCode",
          text: "车牌",
          value: "",
          style: { width: "120px" }
        },
        {
          index: 2,
          isShow: false,
          type: "datePicker",
          name: "query_time",
          text: "告警时间",
          propName: "createTimeFrom,createTimeTo",
          value: today,
          style: { width: "360px" }
        }
        // { index: 1, isShow: false, type: 'text', name: 'emTitle', text: '告警标题', value: '' },
        // { index: 2, isShow: false, type: 'text', name: 'emMsg', text: '告警内容', value: '' }
      ],
      theadsInfo: [
        { index: 0, isShow: false, prop: "reno", text: "序号", width: 68 },
        {
          index: 1,
          isShow: false,
          prop: "parkName",
          text: "停车场",
          width: 250
        },
        {
          index: 2,
          isShow: false,
          prop: "channelName",
          text: "通道",
          width: 250
        },
        {
          index: 3,
          isShow: false,
          prop: "carTypeStr",
          text: "车辆类型",
          width: 100
        },
        {
          index: 4,
          isShow: false,
          prop: "carCode",
          text: "车牌号码",
          width: 100
        },
        // { index: 1, isShow: false, prop: 'emTitle', text: '告警标题', minWidth: 150 },
        // { index: 2, isShow: false, prop: 'emMsg', text: '告警内容', minWidth: 250 },
        {
          index: 5,
          isShow: false,
          prop: "createTime",
          text: "告警时间",
          minWidth: 100
        }
      ],
      tbodysInfo: []
    };
  },
  methods: {}
};
</script>
